<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>保单险种明细 管理</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="insPlcTypDtl_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">

        <div class="fieldBox col_100">
            <div class="label">保单ID</div>
            <div class="field">
                <input name="insPlcId" id="insPlcId" type="text" class="ui-textbox" value="${insPlcTypDtlVO.insPlcId}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">险种ID</div>
            <div class="field">
                <input name="insTypId" id="insTypId" type="text" class="ui-textbox" value="${insPlcTypDtlVO.insTypId}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">null</div>
            <div class="field">
                <input name="insTypNm" id="insTypNm" type="text" class="ui-textbox" value="${insPlcTypDtlVO.insTypNm}"
                       validate="{required:true,maxlength:50}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">保险金额（元）</div>
            <div class="field">
                <input name="insAmt" id="insAmt" type="text" class="ui-textbox" value="${insPlcTypDtlVO.insAmt}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">保费金额（元）</div>
            <div class="field">
                <input name="insFee" id="insFee" type="text" class="ui-textbox" value="${insPlcTypDtlVO.insFee}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">不计免赔金额（元）</div>
            <div class="field">
                <input name="nonDeduAmt" id="nonDeduAmt" type="text" class="ui-textbox"
                       value="${insPlcTypDtlVO.nonDeduAmt}" validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">null</div>
            <div class="field">
                <textarea name="plcTypRem" id="plcTypRem" class="ui-textarea l-textarea" cols="25" rows="4"
                          value="${insPlcTypDtlVO.plcTypRem}"
                          validate="{required:false,maxlength:100}">${insPlcTypDtlVO.plcTypRem}</textarea>
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">类型：1.投保清单 2.保单 3.批单</div>
            <div class="field">
                <input name="dtlTyp" id="dtlTyp" type="text" class="ui-textbox" value="${insPlcTypDtlVO.dtlTyp}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">批单ID</div>
            <div class="field">
                <input name="apprId" id="apprId" type="text" class="ui-textbox" value="${insPlcTypDtlVO.apprId}"
                       validate="{required:true,number:true}">
                <span class="requiredSymbol">*</span>
            </div>
        </div>
    </div>
    <div class="btnsBox">
        <span id="saveInsPlcTypDtl_Btn" class="sq-button sq-button-hasicon l-dialog-btn-ok">
        <i class="sqBtnIco_10"></i>保存</span>
        <input type="reset" id="resetBtn" class="l-button l-button-reset Hide">
    </div>
</form>
<script>
    $(function () {
        var insPlcTypDtlId = "${insPlcTypDtlVO.id}";//主键ID
        $("#insPlcTypDtl_form").ligerForm({
            validate: true
        });
        /*保存*/
        $("#saveInsPlcTypDtl_Btn").click(function (event) {
            var form = liger.get("insPlcTypDtl_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            $.ligerDialog.hide();
            var _url;
            if (insPlcTypDtlId == '') {//新增
                _url = '<%=path%>/insurance/insPlcTypDtl/add.do';
            } else {//修改
                _url = '<%=path%>/insurance/insPlcTypDtl/modify.do?id=' + insPlcTypDtlId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                        parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();

                        //$("#resetBtn").click();
                        //回调刷新列表
                        //var callback=frameElement.W2W.callback;
                        //Remove_navTab();
                        //callback();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });
    });
</script>
</body>
</html>
